/*
ID:ykzhuji1
PROG:namenum
LANG:C++
 */
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
vector<string> dict;
vector<long long> index;
long long getIndex(string& name){
	long long ret=0;
	for(int i=0;i<name.size();i++){
		switch(name[i]){
			case 'A':
			case 'B':
			case 'C':ret=ret*10+2;break;
			case 'D':
			case 'E':
			case 'F':ret=ret*10+3;break;
			case 'G':
			case 'H':
			case 'I':ret=ret*10+4;break;
			case 'J':
			case 'K':
			case 'L':ret=ret*10+5;break;
			case 'M':
			case 'N':
			case 'O':ret=ret*10+6;break;
			case 'P':
			case 'R':
			case 'S':ret=ret*10+7;break;
			case 'T':
			case 'U':
			case 'V':ret=ret*10+8;break;
			case 'W':
			case 'X':
			case 'Y':ret=ret*10+9;break;
		}
	}
	return ret;
}
int main(){
	ifstream fin("namenum.in");
	ifstream dictin("dict.txt");
	ofstream fout("namenum.out");
	long long number;
	string name;
	fin>>number;
	while(!dictin.fail()){
		dictin>>name;
		dict.push_back(name);
		index.push_back(getIndex(name));
	}
	bool flag=false;
	for(int i=0;i<index.size();i++){
		if(index[i]==number){
			flag=true;
			fout<<dict[i]<<endl;
		}
	}
	if(!flag)fout<<"NONE"<<endl;
	return 0;
}
